/*
   CLMain.h

   Created by Miroslav Karpis on 13/11/11.
   Copyright 2011 Miroslav Karpis. All rights reserved.

   This file is part of molecEvol.

   molecEvol is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation, either version 3 of the License, or
   (at your option) any later version.

   Foobar is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with Foobar.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef _CLMAIN_H
#define _CLMAIN_H

#include <iostream>

#include <OpenCL/opencl.h>
#include <CLCore.h>
#include <gpuGard.h>


#ifdef __APPLE__

#include <OpenCL/cl.h>
#include <OpenCL/cl_gl.h>
#include <OpenCL/cl_gl_ext.h>
#include <OpenCL/cl_ext.h>

#else

#include <CL/cl.h>
#include <CL/cl_gl.h>
#include <CL/cl_gl_ext.h>
#include <CL/cl_ext.h>

#endif


using namespace std;

class CLMain : private CLCore{
public:
    CLMain();
    ~CLMain();
    bool initCL();
    

private:
    cl_context context;
    cl_program program;
    cl_kernel kernel;

    gpuGard gard;

    //TODO try the performace difference wit 2D texture
    float *Bij;
    cl_uint seed;
    cl_uint nMolecTypes;
    cl_uint nTotalBij;

    cl_mem memObjects[2];
    cl_command_queue commandQueue;


}; 


#endif // _CLMAIN_H

